import {Component} from '@angular/core';
import {NavController, NavParams,AlertController} from 'ionic-angular';

import {Backend} from '../../providers/backend';


@Component({
  templateUrl: 'build/pages/tab-events/tab-meeting-payment.html'
})
export class Meetingpayment {

  static get parameters() {
    return [[NavController], [NavParams], [Backend],[AlertController]];
  }

  constructor(nav, params, backend,alertController) {
    this.nav = nav;
    this.params = params;
    this.backend = backend;
    this.conference;
    this.relationship;
    this.alertCtrl=alertController;
    this.price = params.get('price');
    this.rmb = params.get('rmb');
    this.oid = params.get('oid');
    this.img3 = 'asset/icon/me3.png';
  }
  signup() {
     console.log(this.relationship);
     if(this.relationship=='alipay'){
       console.log("转账");
        let alert = this.alertCtrl.create({
                title: '请转账至如下银行账户： ',
                subTitle: '账号：0200004209200030587<br>单位名称：北京兰颖泽会展有限公司<br>开户行：工商银行北京和平里北街支行 <br>',
                message: '转账成功后，请截图并发送邮件至admin@gtigroup.org',
                buttons: ['CLOSE']
              });
              alert.present();
     }
  //  var ref = window.open('http://gti.ftbj.net/php/user/pay.php?payFrom='+this.relationship+'&act=payway&oid='+this.oid,'_blank','location=yes');
  //  console.log(ref);
  //     ref.addEventListener('loadstart',function(event){
  //    alert(event.url);
  //    console.log(event.url);
  //    ref.close();
  //   if(event.url.indexOf("http://gti.ftbj.net/php/user/APIError.php")>=0){
  //       ref.close();
  //       $scope.refresh();
        
  //   }});
  //  ref.addEventListener('loadstop', function() {
  //   ref.insertCSS({file: "mystyles.css"});

//     var ref = window.open('http://apache.org', '_blank', 'location=yes');
// ref.close();
  }

}
